<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>同城</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link href="../../plugins/mui/mui.min.css" rel="stylesheet" />
	<script src="../../js/statistics.js"></script>
	<style>
		body{
			font-family: "microsoft yahei",sans-serif;
			background: #ffffff;
		}
		.mui-bar{
			background: #2a2c33;
		}
		.mui-title{
			color:#ffffff;
		}
		.mui-action-back{
			color: #ffffff;
		}
		#publish_ {
			display: inline-block;
			width: 44px;
			height: 44px;
			background: url("../../images/city/publish@2x.png") no-repeat;
			background-size: 100% 100%;
		}
		.mui-pull-right{
			color: #ffffff;
		}
	</style>
</head>
<body>
	<header class="mui-bar mui-bar-nav header">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">同城论坛</h1>
		<a class="mui-icon mui-icon-compose mui-pull-right" id="publish"></a>
	</header>
	<script src="../../plugins/mui/mui.min.js"></script>
	<script>
	mui.init({
		swipeBack: false,
//		statusBarBackground: '#43ac45',
		gestureConfig: {
			doubletap: true
		},
		keyEventBind: {
			backbutton: true,  
			menubutton: true   
		}
	});
	mui.plusReady(function(){
		console.log(999)
		//关闭等待框
		plus.nativeUI.closeWaiting();
		//显示当前页面
		mui.currentWebview.show('slide-in-right',200);
		var self = plus.webview.currentWebview();
		var type = self.type;
		console.log(type)
		//var type_url = self.type_url;
		inittabitemWebviews(type);
//		inittabitemWebviews( type,type_url);
		plus.storage.setItem('city_type',type);
		//跳转帖子发布页
		document.getElementById('publish').addEventListener('tap',function(e){
			e.detail.gesture.preventDefault(); //修复iOS 8.x
			mui.openWindow({
				url:'publish_index.html',
				id:'publish_index',
				show:{
					autoShow:false,
					aniShow:'slide-in-right',
					duration:200
				},
				waiting:{
					autoShow:true,
					title:'正在加载...'
				}
			});
		});
		mui.back = function(){
//			if(type == 'all'){
////				console.log(123)
////				mui.openWindow({
////					url:'../index/index_menu.html'
////				});
//				var web = plus.webview.getWebviewById('../city/tribune_index.html');
//				self.close();
//				web.close();
//				
//			}else if(type == 'alone'){
//				console.log(2)
//				mui.openWindow({
//					url:'../index/entire.html'
//				});
////				var web = plus.webview.getWebviewById('tribune_index');
////				web.close();
//				self.close();
//			}else{
//				console.log(3)
//				mui.openWindow({
//					url:'../city/city.html'
//				});
//				var web = plus.webview.getWebviewById('tribune_index');
//				web.close();
				self.close();
//			}
		}

	});
	function inittabitemWebviews( type){
		console.log(777)
		barItemWebviewArray = mui.preload({
			url:'tribune_lists.html',
			id:'tribune_lists',
			styles:{
				top:'44px',
				bottom: '0',
				left: '0px',
				bounce: 'vertical',
				background:'transparent'
			},
			waiting:{
				autoShow:true,//自动显示等待框，默认为true
				title:'正在加载...'//等待对话框上显示的提示内容
			},
			extras:{
				type:type
//					type_url:type_url
			}
		});
		mainWebview = plus.webview.currentWebview();
		mainWebview.append(barItemWebviewArray);
		barItemWebviewArray.show();
	}
	</script>
</body>
</html>
